import java.util.Scanner;

public class FactorialSumN {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int sum = 0;
        int res = 1;
        for(int i = 1;i<=n;i++) {
            for(int j = 1;j<=i;j++) {
                res *= j;
            }
            sum += res;
            res = 1;
        }
        System.out.println(sum);
    }
}
